import javax.swing.*;
 
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
 
public class test {
 
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		  int delay = 1000; //milliseconds
		  ActionListener taskPerformer = new ActionListener() {
		      public void actionPerformed(ActionEvent evt) {
		          System.out.println(java.util.Calendar.getInstance().getTime().toString());		      
		      }
		  };
		  new Timer(delay, taskPerformer).start();
		  while(true);
 
	}
 
}